<style>
  #bookIndent-update {
    padding: 20px 25px 25px 0;
  }

  #bookIndent-update .layui-treeSelect .ztree li a, .ztree li span {
    margin: 0 0 2px 3px !important;
  }
</style>
<div class="layui-fluid" id="bookIndent-update">
  <form class="layui-form" action="" lay-filter="bookIndent-update-form">
    <input type="hidden" name="id" data-th-value="${bookIndent.id}">
    <input type="hidden" name="pay" data-th-value="${bookIndent.pay}">
    <input type="hidden" name="omit" data-th-value="${bookIndent.omit}">
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">卖家姓名：</label>
      <div class="layui-input-block">
        <input type="text" name="username" minlength="1" maxlength="10" lay-verify="required"
               autocomplete="off" class="layui-input" readonly>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">图书名称：</label>
      <div class="layui-input-block">
        <input type="text" name="bookname" maxlength="20" lay-verify="required"
               autocomplete="off" class="layui-input" readonly>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">出版社：</label>
      <div class="layui-input-block">
        <input type="text" name="pubid" maxlength="20" lay-verify="required"
               autocomplete="off" class="layui-input" readonly>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">单价：</label>
      <div class="layui-input-block">
        <input type="text" name="bookmoney" autocomplete="off" class="layui-input"
               lay-verify="required|number" readonly>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">图书类型：</label>
      <div class="layui-input-block">
        <input type="text" name="type" autocomplete="off" class="layui-input"
               lay-verify="required" readonly>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">购买数量：</label>
      <div class="layui-input-block">
        <input type="text" name="number" autocomplete="off" class="layui-input"
               lay-verify="required" readonly>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">总费用：</label>
      <div class="layui-input-block">
        <input type="text" name="money" autocomplete="off" class="layui-input"
               lay-verify="required" readonly>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require disabled">是否发货：</label>
      <div class="layui-input-block">
        <input type="radio" name="status" value="0" title="未发货" disabled>
        <input type="radio" name="status" value="1" title="已发货" disabled>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">是否收货：</label>
      <div class="layui-input-block">
        <input type="radio" name="flag" value="0" title="未收货" disabled>
        <input type="radio" name="flag" value="1" title="已收货" disabled>
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">手机号码：</label>
      <div class="layui-input-block">
        <input type="text" name="phone" id="phone" minlength="1" maxlength="11" lay-verify="required|number|phone"
               autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label febs-form-item-require">收货地址：</label>
      <div class="layui-input-block">
        <input type="text" name="address" id="address" autocomplete="off" class="layui-input"
               lay-verify="required">
      </div>
    </div>
    <div class="layui-form-item febs-hide">
      <button class="layui-btn" lay-submit="" lay-filter="bookIndent-update-form-submit" id="submit"></button>
    </div>
  </form>
</div>

<script data-th-inline="javascript">
  layui.use(['febs', 'form', 'validate'], function () {
    var $ = layui.$,
        febs = layui.febs,
        layer = layui.layer,
        form = layui.form,
        bookIndent = [[${bookIndent}]],
        $view = $('#bookIndent-update'),
        validate = layui.validate;

    form.verify(validate);
    form.render();
    initbookIndentValue();

    function initbookIndentValue() {
      form.val("bookIndent-update-form", {
        "id": bookIndent.id,
        "bookname": bookIndent.bookname,
        "pubid": bookIndent.pubid,
        "number": bookIndent.number,
        "bookmoney": bookIndent.bookmoney,
        "phone": bookIndent.phone,
        "address": bookIndent.address,
        "username": bookIndent.username,
        "money": bookIndent.money,
        "type": bookIndent.type,
        "flag": bookIndent.flag,
        "status": bookIndent.status,
        "pay": bookIndent.pay,
        "omit": bookIndent.omit,

      });
    }

    form.on('submit(bookIndent-update-form-submit)', function (data) {
      if (febs.nativeEqual(data.field, bookIndent)) {
        febs.alert.warn('数据未作任何修改！');
        return false;
      }
      febs.post(ctx + 'bookIndent/update/', data.field, function () {
        layer.closeAll();
        febs.alert.success("用户" + bookIndent.username + ' 收货信息，修改成功！');
        $('#febs-bookIndent').find('#query').click();
      });
      return false;
    });
  });
</script>